package com.example.demospring5.primary.definebean;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Value;

import org.springframework.stereotype.Component;
import org.springframework.web.context.ContextLoader;

/**
 * @Author ifredomvip@gmail.com
 * @Date 2022/7/29 16:04
 * @Version 1.0.0
 * @Description
 **/
@Component("First")
public class FirstBean {
    Log logger = LogFactory.getLog(ContextLoader.class);
    private String nameDao;
    private String itemDao;
    private SecondBean secondBean;

    public SecondBean getSecondBean() {
        return secondBean;
    }

    public void setSecondBean(SecondBean secondBean) {
        this.secondBean = secondBean;
    }

    public String getNameDao() {
        return nameDao;
    }

    public String getItemDao() {
        return itemDao;
    }

    @Value("StormTank")
    public void setNameDao(String nameDao) {
        this.nameDao = nameDao;
    }

    @Override
    public String toString() {
        return "FirstBean{" +
                "nameDao='" + nameDao + '\'' +
                ", itemDao='" + itemDao + '\'' +
                '}';
    }

    public void setItemDao(String itemDao) {
        this.itemDao = itemDao;
        logger.info("注入====================");
    }
}
